<!DOCTYPE html>
<html lang="en" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"
      xmlns:th="http://www.thymeleaf.org" th:fragment="header(title,keywords)">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>
    <meta name="renderer" content="webkit"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-transform"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>


    <link th:if="${setting} eq null or ${setting.logo} eq null or ${setting.logo} eq ''" rel="shortcut icon" th:href="@{/user/img/bloglogo.jpg}"/>
    <link th:if="${setting} ne null and ${setting.logo} ne null and ${setting.logo} ne ''" rel="shortcut icon" th:href="@{${setting.logo}}"/>


    <link rel="apple-touch-icon" th:href="@{/user/img/apple-touch-icon.png}"/>
    <title>
        <th:block th:text="${title ?: '首页'}"></th:block>
    </title>
    <link th:href="@{/user/css/xcode.min.css}" rel="stylesheet"/>
    <link th:href="@{/user/css/style.min.css}" rel="stylesheet"/>


    <script th:src="@{/assets/js/amazeui.min.js}"></script>
    <link rel="stylesheet" th:href="@{/assets/css/amazeui.min.css}"/>
    <link rel="stylesheet" th:href="@{/assets/css/app.css}"/>
    <!--[if lt IE 9]>
    <script th:src="@{/back/js/html5shiv.js}"></script>
    <script th:src="@{/back/js/respond.min.js}"></script>
    <![endif]-->
</head>


<body gtools_scp_screen_capture_injected="true" th:class="${is_post}?'':'bg-'">
<!--[if lt IE 8]>
<div class="browsehappy" role="dialog">
    当前网页 <strong>不支持</strong> 你正在使用的浏览器. 为了正常的访问, 请 <a href="http://browsehappy.com/" target="_blank">升级你的浏览器</a>。
</div>
<![endif]-->
<header id="header" class="header bg-white">
    <div class="navbar-container">
        <a th:href="@{/page/1}" class="navbar-logo" th:if="${userDetail} ne null">
            <span th:text="${userDetail.blogName}+'个人博客小站'"></span>
        </a>
        <a th:href="@{/page/1}" class="navbar-logo" th:if="${userDetail} eq null">
            <span>游客个人博客小站</span>
        </a>
        <div class="navbar-menu">
            <form name="logoutform" th:action="@{/logout}" method="post"></form>
            <a class="header-info" sec:authorize="isAnonymous()" th:href="@{/loginPage}">登录</a>
            <a class="header-info" sec:authorize="isAuthenticated()"
               href="javascript:document.logoutform.submit();">退出</a>
            <a class="header-info" th:href="@{/toSendEmailPage}">注册</a>
            <a class="header-info" th:href="@{/archive/list}">归档</a>
            <a id="link" class="header-info" data-toggle="modal" data-target="#myModal">友链</a>
            <a class="header-info" th:href="@{/admin/}" target="_blank">后台管理</a>


        </div>

        <div id="searchbox" class="navbar-search">
            <span class="icon-search" onclick="submitData()"></span>
            <form id="form" role="search" th:action="@{/search/1}">
                <span class="search-box">
                    <input type="text" name="searchText" id="search-inp" class="input" placeholder="全站搜索..."
                           maxlength="30"
                           autocomplete="off"/>
                </span>
            </form>
        </div>


    </div>

    <script>
        //js提交表单
        function submitData() {
            document.getElementById("form").submit();
        }

    </script>


</header>
</body>
</html>